<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/layui.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/view.css}"/>
    <link rel="icon" href="/favicon.ico">
    <title>管理后台-技术文章</title>
</head>
<body class="layui-view-body">
<div class="layui-content">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-card-header">
                    <span class="layui-breadcrumb">
                        <a th:target="parent">后台首页</a>
                        <a href="#">下单用户</a>
                    </span>
            </div>
            <div class="layui-card-body">
                <div class="form-box">
                    <div class="layui-form layui-form-item">
                        <form id="courseForm" action="#" th:action="@{/user/credit/list}" method="post">
                            <div class="layui-inline">
                                <div class="layui-form-mid">订单号:</div>
                                <div class="layui-input-inline" style="width: 100px;">
                                    <input id="orderId" type="text" autocomplete="off" name="orderId" th:value="${orderId}" class="layui-input">
                                </div>
                                <div class="layui-form-mid">手机号:</div>
                                <div class="layui-input-inline" style="width: 100px;">
                                    <input type="text" id="mobile" autocomplete="off" name="mobile" th:value="${mobile}" class="layui-input">
                                </div>
                                <input type="button" th:onclick="|queryData()|" class="layui-btn layui-btn-blue" value="查询"></input>
                            </div>
                        </form>
                    </div>
                    <table class="layui-table">
                        <colgroup>
                            <col width="150">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="250">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="80">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th>订单号</th>
                            <th>用户编号</th>
                            <th>用户名</th>
                            <th>身份证</th>
                            <th>手机号</th>
                            <th>产品名称</th>
                            <th>市场价</th>
                            <th>押金金额</th>
                            <th>建议免押额度</th>
                            <th>乐信风险等级</th>
                            <th>申请时间</th>
                            <th>预计租期开始时间</th>
                            <th>预计租期结束时间</th>
                            <th>下单时间</th>
                        </tr>
                        </thead>
                        <tbody id="userData">
                        <tr th:each="credit:${creditList}">
                            <td th:text="${credit.orderId}">贤心</td>
                            <td th:text="${credit.uid}">贤心</td>
                            <td th:text="${credit.name}">贤心</td>
                            <td th:text="${credit.creditId}">贤心</td>
                            <td th:text="${credit.mobile}">贤心</td>
                            <td th:text="${credit.productName}">贤心</td>
                            <td th:text="${credit.martAmount}">贤心</td>
                            <td th:text="${credit.depositeAmount}">贤心</td>
                            <td th:text="${credit.estimateCreditLimit}">技术</td>
                            <td th:text="${credit.riskLevel}">技术</td>
                            <td th:text="${#calendars.format(credit.applicationTime,'yyyy-MM-dd HH:mm:ss')}">0</td>
                            <td th:text="${#calendars.format(credit.estimateRentBeginTime,'yyyy-MM-dd HH:mm:ss')}">0</td>
                            <td th:text="${#calendars.format(credit.estimateRentEndTime,'yyyy-MM-dd HH:mm:ss')}">0</td>
                            <td th:text="${#calendars.format(credit.createDate,'yyyy-MM-dd HH:mm')}">0</td>
                        </tr>
                        </tbody>
                    </table>
                    <!--分页导航-->
                    <div id="pagination"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/assets/layui.all.js}"></script>
<script type="text/javascript" th:src="@{/assets/js/jquery.min.js}"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    var count = [[${count}]];//总记录数
    var curr = [[${curr}]];//当前页
    var contextPath = [[${#request.getContextPath()}]]; //获取当前应用路径
    /*]]>*/
</script>
<script type="text/javascript">
    layui.use(['laypage', 'element'], function () {
        var laypage = layui.laypage,
            element = layui.element;

        //执行一个laypage实例
        laypage.render({
            elem: 'pagination' //注意，这里的 data 是 ID，不用加 # 号
            , count: count //数据总数，从服务端得到
            , curr: curr
            , limit: 10
            , jump: function (obj, first) {
                //首次不执行
                if (!first) {
                    window.location.href = contextPath + "/user/credit/list?page=" + (obj.curr) + "&size=" + obj.limit
                }
            }
        });

    });
    function queryData() {
        window.location.href = contextPath + "/user/credit/list?page=1&size=10&orderId=" + $("#orderId").val() + "&mobile=" + $("#mobile").val();
    }
</script>
</body>
</html>